package com.tyut.musicdreamer.framework.starter.convention.exception;

import com.tyut.musicdreamer.framework.starter.convention.respstatus.RespStatus;
import lombok.Getter;

/**
 * 远程服务调用异常
 */
@Getter
public class RemoteException extends AbstractException {

    public RemoteException(String message) {
        super(message);
    }

    public RemoteException(RespStatus errorStatus) {
        super(errorStatus.code(), errorStatus.message());
    }

    public RemoteException(String errorCode, String errorMessage) {
        super(errorCode, errorMessage);
    }

    public RemoteException(RespStatus errorStatus, Throwable cause) {
        super(errorStatus.code(), errorStatus.message(), cause);
    }

    public RemoteException(String errorCode, String errorMessage, Throwable cause) {
        super(errorCode, errorMessage, cause);
    }

    public RemoteException(Throwable cause) {
        super(cause);
    }

    @Override
    public String toString() {
        return "RemoteException{" +
                "code='" + errorCode + "'," +
                "message='" + errorMessage + "'" +
                '}';
    }
}
